<?php
include("../../tools/session.php");
include("../../tools/controls.php");

// 如果登录失败、无权限访问，那么采取相应措施
if (!($is_login_success === true)) { session_hop_page("../index.php"); exit(); }
if (!power_check(0)) { include("tpl-inc-wp.php"); $tpl->display($oa_tpl_path . "/no-power.html"); exit(); }

/*-- 以下是实际内容 --*/
/* 本程序页面同时处理页面的显示和数据的提交，
   如果有数据提交，则处理数据，如果没有数据提交，
   则显示页面。
*/
include("tpl-inc-wp.php");
include("../../tools/mysql.php");
db_connect();

$sql4 = "SELECT * FROM office";
$sql5 = "SELECT * FROM usergroup";

$re4 = db_query($sql4);
$re5 = db_query($sql5);

$options4 = array(0 => "未分配办公室");
$options5 = array(0 => "未分配组");

foreach ($re4 as $v) { $options4[$v["office_id"]] = $v["zh_name"]; }
foreach ($re5 as $v) { $options5[$v["group_id"]] = $v["zh_name"]; }

$tpl->assign("options_office", $options4);
$tpl->assign("options_office_default", 0);
$tpl->assign("options_group", $options5);
$tpl->assign("options_group_default", 0);

$tpl->display($oa_tpl_path . "/default/add_person.html");

?>

